package com.neo.service;

import javax.jms.Destination;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.jms.core.JmsMessagingTemplate;
import org.springframework.stereotype.Service;

/**
 * 
 * @author Administrator
 *
 */
@Service
public class ActiveMQImpl implements IActiveMQ{

	 @Autowired // 也可以注入JmsTemplate，JmsMessagingTemplate对JmsTemplate进行了封装  
	 private JmsMessagingTemplate jmsTemplate;
	 /**
	  * 发送消息
	  * @param destination
	  * @param message
	  */
	 @Override
	 public void sendMessage(Destination destination, final String message){  
		      jmsTemplate.convertAndSend(destination, message);  
		    } 

}
